package xyz.xtt.exchange.service;

import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import com.tongtong.share.params.AuditRequest;
import com.tongtong.share.params.SendVerifyParams;
import com.tongtong.share.params.VideoAuditingParams;
import com.tongtong.share.response.AuditResponse;
import com.tongtong.share.response.BatchImageAuditingResponse;
import com.tongtong.share.response.ImageAuditResponse;
import com.tongtong.share.response.VideoAuditResponse;
import com.tongtong.share.vo.CredentialRes;

import xyz.xtt.asset.api.enums.AssetTypeEnum;
import xyz.xtt.asset.client.request.CardInfoRequest;
import xyz.xtt.asset.client.response.AssetAccountResponse;
import xyz.xtt.asset.client.response.AssetAllInfoResponse;
import xyz.xtt.asset.client.response.AssetDetailInfo;
import xyz.xtt.asset.client.response.AssetGroupResponse;
import xyz.xtt.asset.client.response.AssetVo;
import xyz.xtt.asset.client.response.BlindBoxDetailResponse;
import xyz.xtt.asset.client.response.NftListVo;
import xyz.xtt.asset.client.response.TblAssetCardDto;
import xyz.xtt.asset.client.response.TransactionResponse;
import xyz.xtt.equity.api.dto.TblUserBenefitByAssetIdDto;
import xyz.xtt.equity.client.response.AssetEntitlementResponse;
import xyz.xtt.pay.api.enums.PayOrderBusinessTypeEnum;
import xyz.xtt.pay.client.request.BusinessOrderRequest;
import xyz.xtt.pay.client.response.BusinessOrderDto;
import xyz.xtt.pay.client.response.BusinessOrderResponse;
import xyz.xtt.pay.client.response.PayOrderResponse;
import xyz.xtt.pay.client.response.TblPayOrderDto;
import xyz.xtt.user.client.response.UserInfoResponse;

/**
 * 内部服务调用
 * 
 * @author huqibo
 * @date 2025/03/17
 */
public interface IInnerService {

	/**
	 * @param appUid
	 * @return
	 */
	UserInfoResponse userInfo(Long appUid);

	/**
	 * @param uid
	 * @param type
	 * @param currPage
	 * @param pageSize
	 * @param sortType
	 * @param sortOrder
	 * @return
	 */
	List<NftListVo> index(Long uid, Integer type, Integer currPage, Integer pageSize, String sortType, String sortOrder);

	/**
	 * 批量获取用户信息
	 * 
	 * @param appUid
	 * @return
	 */
	List<UserInfoResponse> userInfo(Collection<Long> appUid);

	/**
	 * 资产详情
	 * 
	 * @param goodsId
	 * @return
	 */
	AssetAllInfoResponse infoGoodsId(String goodsId);

	/**
	 * 资产权益
	 * 
	 * @param assetId
	 * @return
	 */
	List<AssetEntitlementResponse> assetEntitlementWithAssetId(Long assetId);

	/**
	 * 帐户余额
	 * 
	 * @param assetId
	 * @param appUid
	 * @return
	 */
	AssetAccountResponse accountInfoCheckAmount(Long assetId, Long appUid);

	/**
	 * @param assetId
	 * @param appUid
	 * @return
	 */
	List<Long> entitlementDeliver(Long assetId, Long appUid);

	/**
	 * @param assetId
	 * @param appUid
	 * @return
	 */
	TransactionResponse queryNotPaiedPersonalMintUpChaninOrder(Long assetId, String appUid);

	/**
	 * 帐户余额
	 * 
	 * @param assetId
	 * @param appUid
	 * @return
	 */
	AssetAccountResponse accountInfoUnCheckAmount(Long assetId, Long appUid);

	/**
	 * @param appUid
	 * @param goodsId
	 * @return
	 */
	BigDecimal buyMaxPriceWithHistory(String appUid, String goodsId);

	List<TblAssetCardDto> getUserCardInfo(CardInfoRequest cardInfoRequest);

	/**
	 * @param businessOrderRequest
	 * @return
	 */
	List<BusinessOrderDto> selectListByGoodsIds(BusinessOrderRequest businessOrderRequest);

	/**
	 * @param assetId
	 * @return
	 */
	AssetGroupResponse group(Long assetId);

	TblPayOrderDto fetchPayOrder(Long payOrderId);

	/**
	 * 查询用户权益数据
	 * 
	 * @param appUserId
	 * @param benefitCodes
	 * @return
	 */
	Map<String, Integer> getUserBenefits(long appUserId, String benefitCodes);

	/**
	 * 用户权益消耗
	 * 
	 * @param appUserId
	 * @param benefitCode
	 * @param consumeNum
	 * @param operateBusinessId
	 * @param operateDesc
	 * @return
	 */
	Boolean userBenefitConsumed(long appUserId, String benefitCode, int consumeNum, Long operateBusinessId, String operateDesc);

	/**
	 * 是日正当中需要实名认证
	 * 
	 * @param uid
	 * @param authCheckFrequency
	 * @return
	 */
	Boolean checkAuth(String uid, Long authCheckFrequency);

	/**
	 * 用户权益消耗
	 *
	 * @param appUserId         用户id
	 * @param benefitCode       权益code
	 * @param consumeNum        消耗数量
	 * @param operateBusinessId 操作业务id。可空。比如铸造消耗权益时传铸造审核记录id
	 * @param operateDesc       操作描述。比如铸造消耗权益时传：铸造审核或更具体信息
	 * @return 返回实际消耗次数
	 */
	Integer userBenefitConsumeAsMuchAsPossible(long appUserId, String benefitCode, int consumeNum, Long operateBusinessId, String operateDesc);

	/**
	 * 恢复已消耗用户权益
	 * 
	 * @param appUserId         用户id
	 * @param operateBusinessId 操作业务id。可空。比如铸造审核不通过时恢复权益时传铸造审核记录id
	 * @param operateDesc       操作描述。可空。比如铸造审核不通过恢复权益时传：铸造审核不通过或更具体信息
	 */
	Boolean userBenefitRecover(long appUserId, Long operateBusinessId, String operateDesc);

	List<AssetVo> queryAssetType(Integer currPage, String uid, AssetTypeEnum type);

	List<BlindBoxDetailResponse> queryBlindBoxDetail(List<String> goodsId);

	PayOrderResponse queryPayStatus(Long businessRefId, Integer businessType);

	Map<String, AssetAllInfoResponse> batchInfoGoodsIds(Collection<String> goodsId);

	String receiveVerifyRequest(String certifyId);

	Map<String, String> sendVerify(SendVerifyParams params);

	CredentialRes getCredential();

	/**
	 * 图生图
	 * 
	 * @param key
	 * @param style
	 * @return
	 */
	String imageToImage(String key, String style);

	/**
	 * 视频审核
	 * 
	 * @param request
	 * @return
	 */
	VideoAuditResponse videoAuditing(VideoAuditingParams request);

	VideoAuditResponse receiveVideoAuditing(String jobId);

	/**
	 * 图片审核
	 * 
	 * @param key
	 * @return
	 */
	AuditResponse txAuditing(String key);

	AuditResponse textAudit(AuditRequest auditRequest);

	Boolean adjustPopularityRate(String goodsId, int targetValue);

	BusinessOrderResponse businessOrderInfoWithId(Long businessOrderId);

	PayOrderResponse infoPayOrderWithBusinessRefId(String businessRefId, PayOrderBusinessTypeEnum businessType);

	AssetDetailInfo detailInfo(String uid, String goodsId, Long accountId);

	TblUserBenefitByAssetIdDto getBenefitDetailInfo(String appUserId, Long assetId);

	List<ImageAuditResponse> describeAuditingImageRequestId(String jobId);

	BatchImageAuditingResponse batchImageAuditing(String imageUrl);

}
